﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace iLangl.Tests.SerializationFixture
{
	[TestClass]
	public class AlertValidationTest : BaseTest
	{
		[TestMethod]
		public void AlertValidation()
		{
			IAlert alert = Facade.Instance.AlertManager.CreateAlert(this, new NotImplementedException("This is test exception!"));

			AlertSerializeContext serializeContext = new AlertSerializeContext();
			serializeContext.SetContext(alert);

			String serializedalerttext = (String)serializeContext.GetContext();

			ISerializedAlert serializealert = Facade.Instance.AlertManager.CreateSerializedAlert(alert);

			Assert.AreEqual(alert.Id, serializealert.Id);
			Assert.AreEqual(alert.Created, serializealert.Created);
			Assert.AreEqual(alert.Severity, serializealert.Severity);
			Assert.AreEqual(alert.Source, serializealert.Source);
			Assert.AreEqual(serializedalerttext, serializealert.Content);

		}
	}
}
